let vm = new Vue({
    el:'.main-container',  //选中整个main
    data:{
        app:{},//初始化对象     vue建议声明对象同时进行初始化，避免undefinded
    },
    methods:{
        updateAppInfo:function () {
            axios({
                url:'/guguanjia/manager/app/updateAppInfo',
                method:'put',
                data:this.app
            }).then(response=>{
                //不成功提示
                if(response.data.success){
                    let index = parent.layer.getFrameIndex(window.name);//根据当前窗体名字获取其索引值
                    //console.log(index);
                    parent.layer.close(index);//根据索引值关闭子窗口
                    parent.layer.msg("更新成功");//根据索引值关闭子窗口
                }else {
                    layer.msg(response.data.msg);
                }
            }).catch(error=>{
                layer.msg(error.message);
            })
        },
        cancelUpdate:function () {
            let index = parent.layer.getFrameIndex(window.name);//根据当前窗体名字获取其索引值
            //console.log(index);
            parent.layer.close(index);//根据索引值关闭子窗口
            parent.layer.msg("取消更新");
        }
    },
    created:function () {
        this.app = parent.layer.obj;
        //console.log(parent.layer.obj);
    }
});